package Math;
/*
java.util.Math类是数学相关的类，里面提供了大量的静态方法，完成与数学运算相关的操作

*/
public class Demo01Math {
    public static void main(String[] args) {
        //取绝对值
        System.out.println(Math.abs(3.154));
        System.out.println(Math.abs(-0.15));

        //向上取整
        System.out.println(Math.ceil(3.1));
        System.out.println(Math.ceil(3.0));

        //向下取整
        System.out.println(Math.floor(2.1));
        System.out.println(Math.floor(2.99));

        //四舍五入
        System.out.println(Math.round(20.4));
        System.out.println(Math.round(20.5));

        System.out.println(Math.PI);
    }
}
